package com.CloudDream.Util;

import com.CloudDream.Inventory.InventoryItem;
import com.CloudDream.MoonCake;
import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ShapedRecipe;


public class RecipeUtil {
    public static MoonCake instance = MoonCake.getInstance();

    public static void Ingredient() {
        //月饼皮
        NamespacedKey flour = new NamespacedKey(instance, "flour1");
        ShapedRecipe flour1 = new ShapedRecipe(flour, InventoryItem.getMaterial(0));
        flour1.shape(new String[]{"AAA", "ABA", "AAA"});
        flour1.setIngredient('A', Material.WHEAT);
        flour1.setIngredient('B', XMaterial.POTION.parseMaterial());

        //枧水
        NamespacedKey js = new NamespacedKey(instance, "js1");
        ShapedRecipe js1 = new ShapedRecipe(js, InventoryItem.getMaterial(2));
        js1.shape(new String[]{"AAA", "ABA", "AAA"});
        js1.setIngredient('A', XMaterial.SNOWBALL.parseMaterial());
        js1.setIngredient('B', XMaterial.POTION.parseMaterial());

        //花生油
        NamespacedKey hsy = new NamespacedKey(instance, "hsy1");
        ShapedRecipe hsy1 = new ShapedRecipe(hsy, InventoryItem.getMaterial(3));
        hsy1.shape(new String[]{"ACA", "ABA", "ADA"});
        hsy1.setIngredient('A', XMaterial.WHEAT_SEEDS.parseMaterial());
        hsy1.setIngredient('B', XMaterial.POTION.parseMaterial());
        hsy1.setIngredient('C', Material.PUMPKIN_SEEDS);
        hsy1.setIngredient('D', Material.MELON_SEEDS);

        //糖浆
        NamespacedKey tj = new NamespacedKey(instance, "tj1");
        ShapedRecipe tj1 = new ShapedRecipe(tj, InventoryItem.getMaterial(4));
        tj1.shape(new String[]{"AAA", "ABA", "AAA"});
        tj1.setIngredient('A', Material.SUGAR);
        tj1.setIngredient('B', XMaterial.POTION.parseMaterial());

        //盐
        NamespacedKey y = new NamespacedKey(instance, "y1");
        ShapedRecipe y1 = new ShapedRecipe(y, InventoryItem.getMaterial(5));
        y1.shape(new String[]{"AAA", "AAA", "AAA"});
        y1.setIngredient('A', XMaterial.SNOWBALL.parseMaterial());

        //奶粉
        NamespacedKey nf = new NamespacedKey(instance, "nf1");
        ShapedRecipe nf1 = new ShapedRecipe(nf, InventoryItem.getMaterial(6));
        nf1.shape(new String[]{"AAA", "ABA", "AAA"});
        nf1.setIngredient('A', Material.MILK_BUCKET);
        nf1.setIngredient('B', Material.BOWL);

        //冰糖
        NamespacedKey bt = new NamespacedKey(instance, "bt1");
        ShapedRecipe bt1 = new ShapedRecipe(bt, InventoryItem.getMaterial(7));
        bt1.shape(new String[]{"AAA", "ABA", "AAA"});
        bt1.setIngredient('A', Material.ICE);
        bt1.setIngredient('B', Material.SUGAR);

        //玫瑰馅料
        NamespacedKey mg = new NamespacedKey(instance, "mg1");
        ShapedRecipe mg1 = new ShapedRecipe(mg, InventoryItem.getMaterial(8));
        mg1.shape(new String[]{"AAA", "ABA", "AAA"});
        mg1.setIngredient('A', XMaterial.POPPY.parseMaterial());
        mg1.setIngredient('B', Material.WATER_BUCKET);

        //果酱
        NamespacedKey gj = new NamespacedKey(instance, "gj1");
        ShapedRecipe gj1 = new ShapedRecipe(gj, InventoryItem.getMaterial(9));
        gj1.shape(new String[]{"EAE", "BEC", "EDE"});
        gj1.setIngredient('A', Material.APPLE);
        gj1.setIngredient('B', XMaterial.MELON_SLICE.parseMaterial());
        gj1.setIngredient('C', XMaterial.CARROT.parseMaterial());
        gj1.setIngredient('D', XMaterial.POTION.parseMaterial());
        gj1.setIngredient('E', Material.SUGAR);

        //肉松
        NamespacedKey rs = new NamespacedKey(instance, "rs1");
        ShapedRecipe rs1 = new ShapedRecipe(rs, InventoryItem.getMaterial(10));
        rs1.shape(new String[]{"ABA", "CDC", "EBE"});
        rs1.setIngredient('A', XMaterial.RABBIT.parseMaterial());
        rs1.setIngredient('B', XMaterial.CHICKEN.parseMaterial());
        rs1.setIngredient('C', XMaterial.BEEF.parseMaterial());
        rs1.setIngredient('D', Material.SUGAR);
        rs1.setIngredient('E', XMaterial.PORKCHOP.parseMaterial());

        //莲蓉
        NamespacedKey lr = new NamespacedKey(instance, "lr1");
        ShapedRecipe lr2 = new ShapedRecipe(lr, InventoryItem.getMaterial(11));
        lr2.shape(new String[]{"DAD", "BCB", "DAD"});
        lr2.setIngredient('A', Material.MELON_SEEDS);
        lr2.setIngredient('B', XMaterial.WHEAT_SEEDS.parseMaterial());
        lr2.setIngredient('C', Material.WATER_BUCKET);
        lr2.setIngredient('D', Material.SUGAR);

        //蛋黄
        NamespacedKey dh = new NamespacedKey(instance, "dh1");
        ShapedRecipe dh1 = new ShapedRecipe(dh, InventoryItem.getMaterial(12));
        dh1.shape(new String[]{"ACA", "BBB", "ACA"});
        dh1.setIngredient('A', Material.SUGAR);
        dh1.setIngredient('B', Material.EGG);
        dh1.setIngredient('C', Material.WHEAT);

        //五仁
        NamespacedKey wr = new NamespacedKey(instance, "wr");
        ShapedRecipe wr1 = new ShapedRecipe(wr, InventoryItem.getMaterial(12));
        wr1.shape("ABA");
        wr1.setIngredient('A', Material.SUGAR);
        wr1.setIngredient('B', Material.WHEAT);


        Bukkit.getServer().resetRecipes();
        Bukkit.getServer().addRecipe(flour1);
        Bukkit.getServer().addRecipe(rs1);
        Bukkit.getServer().addRecipe(dh1);
        Bukkit.getServer().addRecipe(lr2);
        Bukkit.getServer().addRecipe(hsy1);
        Bukkit.getServer().addRecipe(nf1);
        Bukkit.getServer().addRecipe(js1);
        Bukkit.getServer().addRecipe(bt1);
        Bukkit.getServer().addRecipe(mg1);
        Bukkit.getServer().addRecipe(gj1);
        Bukkit.getServer().addRecipe(y1);
        Bukkit.getServer().addRecipe(tj1);
        Bukkit.getServer().addRecipe(wr1);
    }
}
